<?php

namespace Application;

use Zend\Mvc\ModuleRouteListener as ZendModuleRouteListener;

use Zend\Stdlib\ArrayUtils;

class Module
{
    public function onBootstrap($e)
    {
        $e->getApplication()->getServiceManager()->get('translator');
        $eventManager        = $e->getApplication()->getEventManager();
        
        $zendModuleRouteListener = new ZendModuleRouteListener();
        $zendModuleRouteListener->attach($eventManager);
    }

    public function getConfig()
    {
    	$config = array();
    	$moduleConfig = include __DIR__ . '/config/module.config.php';
    	$routesConfig = include __DIR__ . '/config/routes.config.php';
    	
    	$config = ArrayUtils::merge($moduleConfig, $routesConfig);
        return $config;
    }

    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                	//__NAMESPACE__ => __DIR__ . '/src/Application',
                    __NAMESPACE__.'\Admin' => __DIR__ . '/src/Admin',
					__NAMESPACE__.'\Front' => __DIR__ . '/src/Front',
                ),
            ),
        );
    }

}
